<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "d_try.index_manage".
 *
 * @property string $id
 * @property integer $goods_id
 * @property string $recommend_starttime
 * @property string $recommend_endtime
 * @property integer $type
 * @property integer $sort
 * @property integer $status
 * @property string $add_time
 * @property string $create_user
 */
class IndexManage extends \yii\db\ActiveRecord
{
    
    public static $TYPE = [1=>'每日一试',2=>'限时抢购',3=>'热卖推荐'];
    
    public static $STATUS = [0=>'不显示',1=>'显示'];
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'd_try.index_manage';
    }

    public function getType()
    {
        return self::$TYPE;
    }
    
    public function getStatus()
    {
        return self::$STATUS;
    }
    
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['goods_id', 'recommend_starttime', 'type'], 'required'],
            [['goods_id', 'type', 'sort', 'status'], 'integer'],
            [['recommend_starttime', 'recommend_endtime', 'add_time'], 'safe'],
            [['create_user'], 'string', 'max' => 20],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'goods_id' => '商品ID',
            'recommend_starttime' => '推荐起始时间',
            'recommend_endtime' => '推荐截至时间',
            'type' => '种类',
            'sort' => '排序',
            'status' => '是否显示',
            'add_time' => '添加时间',
            'create_user' => '创建者',
        ];
    }

    /**
     * @inheritdoc
     * @return \services\models\IndexManageQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \services\models\IndexManageQuery(get_called_class());
    }
}
